<html>
<head>
<meta charset="utf-8" />
<link type="text/css" rel="stylesheet" href="style.css" />
<link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css" rel="stylesheet" type="text/css" />
<link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeRDark.css" rel="stylesheet" type="text/css" />
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js" type="text/javascript"></script>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js" type="text/javascript"></script>
<script type="text/javascript">
SyntaxHighlighter.all();
</script>
</head>
<body>
<div class="header" style="border-top: 1px solid #C9D7F1;margin: 9px;margin-top: 24px;padding-top: 5px;margin-bottom: 10px;">
    <a href="http://code.google.com/p/yuki/"><img src="http://code.google.com/p/yuki/logo?cct=1297980533" /></a>
    <div style="display: inline-block;padding-left: 11px;">
        <div class="project-name">
            <a style="text-decoration: none;color: #666;font-family: arial, sans-serif;font-size: 39px;" href="http://code.google.com/p/yuki/">yuki</a>
        </div>
        <div class="project-summary">
            <a href="http://code.google.com/p/yuki/" style="text-decoration: none;color: #444;font-family: arial, sans-serif;font-size: 13px;">Yuki PHP Framework</a>
        </div>
    </div>
</div>
<table width="100%"><tr><td width="200" valign="top">
<div class="sidebar"><ul><li class="package">yuki<ul><li class="subpackage">autoload<ul><li class="class"><a href="yAutoloader.html">yAutoloader</a></li><li class="class"><a href="yCoreAutoloader.html">yCoreAutoloader</a></li></ul></li><li class="subpackage">output<ul><li class="class"><a href="yBuffer.html">yBuffer</a></li></ul></li><li class="subpackage">callable<ul><li class="class"><a href="yCallable.html">yCallable</a></li></ul></li><li class="subpackage">debug<ul><li class="class"><a href="yDebugger.html">yDebugger</a></li></ul></li><li class="subpackage">geometry<ul><li class="class"><a href="yDimension.html">yDimension</a></li><li class="class"><a href="yPoint.html">yPoint</a></li><li class="class"><a href="yRectangle.html">yRectangle</a></li></ul></li><li class="subpackage">doc<ul><li class="class"><a href="yDocBlock.html">yDocBlock</a></li><li class="class"><a href="yDocumentor.html">yDocumentor</a></li><li class="class"><a href="yMethodDocumentor.html">yMethodDocumentor</a></li></ul></li><li class="subpackage">exception<ul><li class="class"><a href="yException.html">yException</a></li><li class="class"><a href="yExceptionHandler.html">yExceptionHandler</a></li></ul></li><li class="subpackage">file<ul><li class="class"><a href="yFile.html">yFile</a></li></ul></li><li class="subpackage">log<ul><li class="class"><a href="yLogMessage.html">yLogMessage</a></li><li class="class"><a href="yLogRoute.html">yLogRoute</a></li><li class="class"><a href="yLogger.html">yLogger</a></li><li class="class"><a href="yStderrLogRoute.html">yStderrLogRoute</a></li><li class="class"><a href="yStdoutLogRoute.html">yStdoutLogRoute</a></li><li class="class"><a href="yStreamLogRoute.html">yStreamLogRoute</a></li></ul></li><li class="subpackage">profiler<ul><li class="class"><a href="yProfiler.html">yProfiler</a></li></ul></li><li class="subpackage">uri<ul><li class="class"><a href="yUri.html">yUri</a></li><li class="class"><a href="yUriAuthority.html">yUriAuthority</a></li><li class="class"><a href="yUriFragment.html">yUriFragment</a></li><li class="class"><a href="yUriPath.html">yUriPath</a></li><li class="class"><a href="yUriQuery.html">yUriQuery</a></li><li class="class"><a href="yUriScheme.html">yUriScheme</a></li></ul></li></ul></li></ul></div>            
</td><td valign="top">
            
<h1>yDebugger</h1>
<div><b>@package</b> yuki</div>
<div><b>@subpackage</b> debug</div>

<!-- Hierarhy -->

<h2>Introduction</h2>
yDebugger<br />
<br />


<h2>Method Summary</h2>
<div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method">string static <a href="#method.getLinesSource">getLinesSource</a>(<span class="param">$filename, $startLine, $endLine</span>);</div><div style="font-size: 11px; margin-top: 1em;">Gets unformatted lines of source code from file</div></div><div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method">string static <a href="#method.getLineSource">getLineSource</a>(<span class="param">$filename, $line, $padding = 0</span>);</div><div style="font-size: 11px; margin-top: 1em;">Gets unformatted line(s) of source code from file</div></div><div class="summary" style="padding-bottom: 5px;margin-bottom: 5px;border-bottom: 1px solid #AAA;"><div class="method">static <a href="#method.getLineSourceHtml">getLineSourceHtml</a>(<span class="param">$filename, $line, $padding = 0</span>);</div><div style="font-size: 11px; margin-top: 1em;"></div></div>
<h2>Method Details</h2>
<div style="padding: 4px;border: solid 1px #666;"><a name="method.getLinesSource"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method">string static <a href="#method.getLinesSource">getLinesSource</a>(<span class="param">$filename, $startLine, $endLine</span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div><b style="color: #683B00;">$filename</b> (string) File name
</div><div><b style="color: #683B00;">$startLine</b> (int) Start line number, starts at 1
</div><div><b style="color: #683B00;">$endLine</b> (int) End line number
</div><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3>Gets unformatted lines of source code from file
</h3></div></div><div><b>returns</b> string </div></div></div><h3>Source Code</h3><pre class="brush: php">    public static function getLinesSource($filename, $startLine, $endLine){
        if (!is_file($filename)){
            return false;
        }
        $source = '';
        $fp = fopen($filename, 'r');
        $currentLine = 1;
        while (($s = fgets($fp)) !== false){
            if ($currentLine &gt;= $startLine){
                $source .= $s;
            }
            $currentLine++;
            if ($currentLine &gt; $endLine){
                // reached last required line
                break;
            }
        }
        return $source;
    }
</pre></div><div style="padding: 4px;border: solid 1px #666;"><a name="method.getLineSource"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method">string static <a href="#method.getLineSource">getLineSource</a>(<span class="param">$filename, $line, $padding = 0</span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div><b style="color: #683B00;">$filename</b> (string) File name
</div><div><b style="color: #683B00;">$line</b> (int) Line number, starts at 1
</div><div><b style="color: #683B00;">$padding</b> (int) Padding
</div><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3>Gets unformatted line(s) of source code from file
</h3></div></div><div><b>returns</b> string </div></div></div><h3>Source Code</h3><pre class="brush: php">    public static function getLineSource($filename, $line, $padding = 0){
        return self::getLinesSource($filename, $line - $padding, $line + $padding);
    }
</pre></div><div style="padding: 4px;border: solid 1px #666;"><a name="method.getLineSourceHtml"></a><div style="font-size: 11px;"><div class="classsynopsis"><div class="method">static <a href="#method.getLineSourceHtml">getLineSourceHtml</a>(<span class="param">$filename, $line, $padding = 0</span>);</div></div><div style="padding: 7px; margin-bottom: 2em; border: dashed 1px #eee; margin-tOP; 1em;"><div style="margin-top: 1em; margin-bottom: 1em;"><div><h3></h3></div></div></div></div><h3>Source Code</h3><pre class="brush: php">    public static function getLineSourceHtml($filename, $line, $padding = 0){
        $shift = -$padding;
        $lines = explode(&quot;\n&quot;, self::getLineSource($filename, $line, $padding));
        foreach ($lines as &amp;$s){
            $s = '&lt;span class=&quot;line'.($shift == 0?' line_hightlight':'').'&quot;&gt;'.
                    '&lt;span class=&quot;num&quot;&gt;'.($line + $shift).'&lt;/span&gt; '.htmlspecialchars($s).'&lt;/span&gt;';
            $shift++;
        }
        return '&lt;pre&gt;&lt;code&gt;'.implode('', $lines).'&lt;/code&gt;&lt;/pre&gt;';
    }
</pre></div>


<h2>Class synopsis</h2>
<div class="classsynopsis">
<b class="classname">yDebugger</b> {
<div class="contents">
<h3>/* Properties */</h3>

<h3>/* Methods */</h3>
<div class="method">string static <a href="#method.getLinesSource">getLinesSource</a>(<span class="param">$filename, $startLine, $endLine</span>);</div><div class="method">string static <a href="#method.getLineSource">getLineSource</a>(<span class="param">$filename, $line, $padding = 0</span>);</div><div class="method">static <a href="#method.getLineSourceHtml">getLineSourceHtml</a>(<span class="param">$filename, $line, $padding = 0</span>);</div>
</div>
}
</div>


</td></tr></table>
</body>
</html>